package com.qiyi.player.base.uuid
{
   import flash.events.EventDispatcher;
   import flash.events.Event;
   
   public class UUIDManager extends EventDispatcher implements IUUID
   {
      
      public function UUIDManager(param1:SingletonClass) {
         super();
         this.load();
      }
      
      private static var _instance:UUIDManager = null;
      
      public static function get instance() : UUIDManager {
         if(_instance == null)
         {
            _instance = new UUIDManager(new SingletonClass());
         }
         return _instance;
      }
      
      private var _uuid:BaseUUID = null;
      
      public function load(param1:String = "") : void {
         if(this._uuid)
         {
            return;
         }
         if(param1 == "")
         {
            this._uuid = new RemoteUUID("qiyi_statistics");
            this._uuid.addEventListener(RemoteUUID.Evt_Success,this.onSuccess);
            this._uuid.load();
         }
         else
         {
            this._uuid = new LocalUUID(param1,"qiyi_statistics");
         }
      }
      
      private function onSuccess(param1:Event) : void {
         this.dispatchEvent(new UUIDEvent(UUIDEvent.Evt_Ready));
      }
      
      public function get uuid() : String {
         if(this._uuid == null)
         {
            return "";
         }
         return this._uuid.uuid;
      }
      
      public function buildVideoEventID() : void {
         this._uuid.buildVideoEventID();
      }
      
      public function getVideoEventID(param1:String = "") : String {
         return this._uuid.getVideoEventID();
      }
      
      public function get isNewUser() : Boolean {
         return this._uuid.isNewUser;
      }
      
      public function set isNewUser(param1:Boolean) : void {
         this._uuid.isNewUser = param1;
      }
      
      public function setWebEventID(param1:String) : void {
         this._uuid.setWebEventID(param1);
      }
      
      public function getWebEventID() : String {
         return this._uuid.getWebEventID();
      }
   }
}
class SingletonClass extends Object
{
   
   function SingletonClass() {
      super();
   }
}
